home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / mathematica / tex-mma.tar_z / tex-mma / addBBoxpro.awk < prev    next >
Text File  |  1991-02-02  |  750b  |  27 lines

  1. # Filter Mathematica psfix output to change fontsize and bounding box
  2.  
  3. # 2/1/1991 Dan Dill dan@chem.bu.edu
  4. # Based on scheme developed by Cameron Smith cameron@midd.bitnet
  5.  
  6. # Developed with Mathematica 1.2.  May break with 2.0
  7.  
  8. # awk -f addBBoxpro.awk height fontsize asprat
  9. #    height        is in "big points", 72 bp = 1 in
  10. #    fontsixe    is in bp
  11. #    asprat        is a decimal number
  12.  
  13. BEGIN { 
  14.     height = ARGV[1]; ARGV[1] = ""        # Don't treat arg as input file
  15.     fontsize = ARGV[2]; ARGV[2] = ""    # ..
  16.     aspratio = ARGV[3]; ARGV[3] = ""    # ..
  17.     width = int(height / aspratio)
  18. }
  19. /BoundingBox/ {$4 = width; $5 = height}
  20. /^\/Mfontsize/ {$2 = fontsize}
  21. /^\/M[lrtb]marg/ {$2 = 0}
  22. /^\/Mwidth/ {$2 = width; $3 = ""; $4 = ""}
  23. /^\/Mheight/ {$2 = height; $3 = ""; $4 = ""}
  24. {print}
  25.  
  26.  
  27.